package com.bdqn.service;

import com.bdqn.mapper.StorageRecordMapper;
import com.bdqn.mapper.StorageRecordMapperImpl;
import com.bdqn.pojo.StorageRecord;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Transactional
@Service("storageRecordService")
public class StorageRecordServiceImpl implements StorageRecordService{
    private StorageRecordMapper strMapper;
    @Transactional
    @Override
    public boolean add(StorageRecord str) {
        try {
            return strMapper.add(str);
        } catch (RuntimeException e) {
            e.printStackTrace();
            throw e;
        }
    }

    @Override
    public int del(int id) {
        return strMapper.del(id);
    }

    @Override
    public int upd(int id, String goodsName) {
        return strMapper.upd(id, goodsName);
    }

    public void setStrMapper(StorageRecordMapper strMapper) {
        this.strMapper = strMapper;
    }
}
